package vista;
import java.awt.BorderLayout;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import controlador.ContCompra;
import controlador.ContOrden;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DlgCompra extends javax.swing.JDialog {
	private JPanel pnlCompra;
	private JScrollPane jScrollPane1;
	private JButton btSalir;
	private JButton btAceptar;
	private JButton btQuitar;
	private JButton btAnadir;
	private JTable tblCompra;

	private ContCompra controlador;

	public DlgCompra(JFrame frame, ContCompra controlador) {
		super(frame);
		this.controlador = controlador;
		initGUI();
	}
	
	private void initGUI() {
		try {
			{
				this.setTitle("Compra");
			}
			{
				pnlCompra = new JPanel();
				getContentPane().add(pnlCompra, BorderLayout.CENTER);
				pnlCompra.setLayout(null);
				pnlCompra.setPreferredSize(new java.awt.Dimension(368, 261));
				{
					jScrollPane1 = new JScrollPane();
					pnlCompra.add(jScrollPane1);
					jScrollPane1.setBounds(57, 27, 265, 116);
					{
						
						tblCompra = new JTable();
						jScrollPane1.setViewportView(tblCompra);
						
						tblCompra.setBounds(59, 60, 259, 121);
						
					}
				}
				{
					btAnadir = new JButton();
					pnlCompra.add(btAnadir);
					btAnadir.setText("Agregar");
					btAnadir.setBounds(81, 155, 96, 21);
				}
				{
					btQuitar = new JButton();
					pnlCompra.add(btQuitar);
					btQuitar.setText("Quitar");
					btQuitar.setBounds(197, 155, 92, 21);
				}
				{
					btAceptar = new JButton();
					pnlCompra.add(btAceptar);
					btAceptar.setText("Aceptar");
					btAceptar.setBounds(140, 223, 90, 26);
				}
				{
					btSalir = new JButton();
					pnlCompra.add(btSalir);
					btSalir.setText("Salir");
					btSalir.setBounds(262, 223, 75, 26);
				}
			}
			this.setSize(378, 299);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public JTable getTblCompra() {
		return tblCompra;
	}
	
	
	public JButton getBtAnadir() {
		return btAnadir;
	}
	
	public JButton getBtQuitar() {
		return btQuitar;
	}

	public JButton getBtAceptar() {
		return btAceptar;
	}

	public JButton getBtSalir() {
		return btSalir;
	}
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}

}
